﻿//-----------------------------------------------------------------------
// <copyright>
// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
// </copyright>
//----------------------------------------------------------------------- 
using System;
using System.IO;

namespace Fulcrum.ViewModelGenerator.UnitTests
{
    partial class TestSample
    {
        public bool ValidationResponse { get; set; }

        public bool OnValidatedStringPropertyValidatingImplementationCalled { get; private set; }
        public bool OnValidatedStringPropertyChangedImplementationCalled { get; private set; }
        public bool OnReadOnlyIntPropertyChangedImplementationCalled { get; private set; }

        public TestSample()
        {
            this.ValidationResponse = true;
        }

        partial void OnValidatedStringPropertyValidatingImplementation(string value, ref bool isValid)
        {
            this.OnValidatedStringPropertyValidatingImplementationCalled = true;
            isValid = this.ValidationResponse;
        }

        partial void OnValidatedStringPropertyChangedImplementation(PropertyChangedEventArgs<string> e)
        {
            this.OnValidatedStringPropertyChangedImplementationCalled = true;
        }

        partial void OnReadOnlyIntPropertyChangedImplementation(PropertyChangedEventArgs<int> e)
        {
            this.OnReadOnlyIntPropertyChangedImplementationCalled = true;
        }

        partial void CompareCustomComparePropertyImplementation(string oldValue, string newValue, ref bool isEqual)
        {
            isEqual = (oldValue[0] == newValue[0]);
        }

        public void RaiseEventArgsEvent(EventArgs e)
        {
            this.NotifyEventArgsEvent(e);
        }

        public void RaiseNonEventArgsEvent(FileSystemEventArgs e)
        {
            this.NotifyNonEventArgsEvent(e);
        }
    }
}
